<%@ page language="Java" import="java.util.*,descriptor.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%
	AcademicSupDescriptor academicSup = (AcademicSupDescriptor)request.getAttribute("academicSup");
	DegreeDescriptor degree = (DegreeDescriptor)request.getAttribute("degree");
	FeedbackListDescriptor feedbackList = (FeedbackListDescriptor)request.getAttribute("feedbackList");
	CompaniesListDescriptor companyList = (CompaniesListDescriptor)request.getAttribute("companyList");
	Hashtable userToCompany = (Hashtable)request.getAttribute("userToCompany");
	UsersListDescriptor userList = (UsersListDescriptor)request.getAttribute("userList");
	if(academicSup == null){
		response.sendRedirect("index.jsp");
	}

%>
<html>
	<jsp:include page="academicSupervisorHeader.jsp" >
		<jsp:param name="pageTitle" value="Work Placement Management System - Academic Supervisor" />
	</jsp:include>
	<body OnLoad="showmenu(document.getElementById('smenu2'));">
		<jsp:include page="academicSupervisorPageHeader.jsp"></jsp:include>
		<div id="container">
			<jsp:include page="academicSupMenu.jsp" ></jsp:include>
			<div id="content">
			<h3 class="posttitle">View Feedback</h3>
				<div class="entry">
<h3>Degre details</h3><br/><br/>
The <%=degree.getName()%> Degree had <%=feedbackList.getFeedbackDescriptors().size()%> feedback<br/><br/>

Degree description :<br/>
<textarea name="freeback" rows="10" cols="50">
<%=degree.getInfos()%>
</textarea>
<br/><br/>

<h3>Feebacks</h3>
<%
for (FeedbackDescriptor feedback:feedbackList.getFeedbackDescriptors()){
UserDescriptor user = userList.getUser(feedback.getAuthorId());
%>
Author : <%=user.getFirstName()%> <%=user.getName()%><br/>

<% if(user.getType()== 8){
%>
Working for : <%=companyList.getCompany((Integer)userToCompany.get(user.getUserId()))%><br/>
<%
}
%>
Content : <br/>
<textarea name="freeback" rows="20" cols="50">
<%=feedback.getInfos()%>
</textarea><br/><br/>


<%
}
%>

				</div>
	    	</div>
			<jsp:include page="academicSupervisorPageFooter.jsp"></jsp:include>
		</div>
	</body>
</html>